package cn.edu.lingnan.exception;


import cn.edu.lingnan.user.dtos.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    /**
     * 处理权限不足或考试中异常
     */
    @ExceptionHandler(RuntimeException.class)
    public Result<String> handleAccessDeniedException(RuntimeException e) {
        return Result.error(e.getMessage());
    }
}